package com.wlc.oop.demo08.interface3;

/**
 * @author 王立朝 wanglichao@champion-credit.com
 * @description 鱼儿
 * @date 2021-07-08 08:19
 */
public class Fish extends Animal implements Pet{

    private String name;
    /**
     * 受保护的构造方法
     *
     * @param legs
     */
    protected Fish(int legs) {
       super(0);
    }

    @Override
    protected void eat() {
        System.out.println("鱼儿吃饭");
    }

    @Override
    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public void play() {
        System.out.println("鱼儿在玩耍。。");
    }
}
